#!/usr/bin/python
# -*- coding:utf-8 -*-

import cv2
img = cv2.imread("img/Montage.jpg")

stride = 512

#crop_img = img[0:512, 0:512]

for i in range(10):
    for j in range(10):
        crop_img = img[i*stride:(i+1)*stride, j*stride:(j+1)*stride]
        cv2.imwrite("cut/Montage_%d-%d.jpg"%(i,j),crop_img);
        #cv2.imshow("cropped", crop_img)
        #
cv2.waitKey(0)

# NOTE: its img[y: y + h, x: x + w] and *not* img[x: x + w, y: y + h]
